package xjvm_v1;

import xjvm_v1.runtime.MyClass;
import xjvm_v1.runtime.RunTimeEnv;

/**
 * Created by xuefengDong: moveb
 * On 2020/7/5- 21:14
 *
 * F:\projects\zvm>java -classpath E:\JAVA\Maven\com\alibaba\fastjson\1.2.62\fastjson-1.2.62.jar;
 * E:\JAVA\Maven\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;
 * F:\projects\zvm\target\classes com.zvm.JavaMain -cp F:\projects\zvm\bytecode gc.GCTest1
 *
 */
public class MyJVM {

    public static RunTimeEnv runTimeEnv;
    public MyJVM(RunTimeEnv runTimeEnv){
        MyJVM.runTimeEnv = runTimeEnv;
    }

    public void callMain(String main, String descriptor, String classPath){
        MyClass myClass = runTimeEnv.methodArea.loadClass(classPath);
//        Interpreter interpreter = new Interpreter(runTimeEnv);
//        interpreter.initInstructions();
//        runTimeEnv.methodArea.linkClass(classPath);
//        interpreter.invokeByName(javaClass, main, descriptor);
    }
}
